@echo off
chcp 65001 >nul
title BUAT RPM
cd /d "%~dp0"
set PY=
where py >nul 2>nul && set PY=py
if "%PY%"=="" (where python >nul 2>nul && set PY=python)
if "%PY%"=="" (where python3 >nul 2>nul && set PY=python3)
if "%PY%"=="" goto nopython

%PY% "atpgen\rpm.py" --form
echo.
pause
exit /b 0

:nopython
echo.
echo ============================================================
echo   PYTHON BELUM TERPASANG DI KOMPUTER INI
echo ============================================================
echo.
echo   Cara memasang:
echo     1. Buka https://www.python.org/downloads/
echo     2. Unduh Python untuk Windows lalu jalankan pemasangnya.
echo     3. PENTING: centang "Add python.exe to PATH" di layar pertama.
echo     4. Selesai memasang, TUTUP jendela ini lalu jalankan lagi.
echo.
echo   Catatan: jangan pakai perintah python3 di Windows, pakai py.
echo.
pause
exit /b 1
